package com.qq.xrx1002.androidgame;

import org.cocos2d.actions.instant.CCHide;
import org.cocos2d.actions.interval.CCDelayTime;
import org.cocos2d.actions.interval.CCSequence;
import org.cocos2d.nodes.CCSprite;

/**
 * Created by Alyson on 2018/11/27.
 */

public class PeaBullet extends Bullet {//做网豆子弹类
    public PeaBullet(ShooterPlant shooterPlant) {
        super("bullet/bullet1.png", shooterPlant);
    }

    @Override
    public void showBulletBlast(Zombie zombie) {
        CCSprite ccSprite_bulletBlast=CCSprite.sprite("bullet/bulletBlast1.png");//设置爆炸效果
        ccSprite_bulletBlast.setPosition(ccp(zombie.getPosition().x,zombie.getPosition().y+60));//设置爆炸的位置在僵尸身上
        getParent().addChild(ccSprite_bulletBlast,6);//添加到地图上
        CCDelayTime ccDelayTime=CCDelayTime.action(0.1f);//0.1秒显示爆炸效果
        CCHide ccHide=CCHide.action();//爆炸完隐藏
        CCSequence ccSequence=CCSequence.actions(ccDelayTime,ccHide);
        ccSprite_bulletBlast.runAction(ccSequence);
    }
}
